fix(docker): harden default SSRF proxy egress#36332
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #36332 +/- ##
==========================================
- Coverage 86.02% 86.01% -0.01%
==========================================
Files 4477 4473 -4
Lines 213442 213403 -39
Branches 39669 39655 -14
==========================================
- Hits 183614 183562 -52
- Misses 26566 26578 +12
- Partials 3262 3263 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a7726f0 to
bcbb072
Compare
Block private, loopback, link-local, multicast, reserved, and metadata target networks in the Docker Compose SSRF proxy while preserving public egress and sandbox reverse proxy access. Add explicit private IP and domain allowlist environment variables for deployments that need trusted private-network access.
bcbb072 to
96622fa
Compare
|
Update: this PR should stay draft/paused until #36397 is resolved. The proxy hardening in this PR blocks loopback, private, link-local, and metadata target networks by default. That is the intended security posture, but it also means local Docker deployments can regress when a Dify-signed We should first land the centralized signed-file retrieval work in #36397, so Dify-owned signed file URLs are verified and resolved through an internal file/storage path instead of being treated as arbitrary external remote URLs through the SSRF proxy. Once that is in place, we can resume this PR without breaking local signed-file flows. |
Summary
Closes #36400.
conf.daccess rules soallow localnetcannot bypass Dify's policy.SSRF_PROXY_ALLOW_PRIVATE_IPS/SSRF_PROXY_ALLOW_PRIVATE_DOMAINSescape hatches for trusted private-network deployments.Note: this PR should remain draft until #36397 is resolved, so Dify-owned signed file URLs can be handled through internal file retrieval instead of the SSRF proxy.
Screenshots
N/A
Checklist